package cn.sciento.farm.devicemanager.service.impl;

import cn.sciento.farm.devicemanager.dao.entity.TenantSmsResidual;
import cn.sciento.farm.devicemanager.dao.mapper.TenantSmsResidualMapper;
import cn.sciento.farm.devicemanager.service.TenantSmsResidualService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author walton
 * @description
 * @date 2020/11/24 11:29
 */
@Service
public class TenantSmsResidualServiceImpl implements TenantSmsResidualService {

    @Autowired
    private TenantSmsResidualMapper smsResidualMapper;

    @Override
    public TenantSmsResidual getSmsResidual() {
        return smsResidualMapper.selectOne(null);
    }

    @Override
    public int updateSmsResidual(TenantSmsResidual residual) {
        return smsResidualMapper.updateById(residual);
    }

    @Override
    public int createSmsResidual(TenantSmsResidual tenantSmsResidual) {
        return smsResidualMapper.insert(tenantSmsResidual);
    }
}